#include <stdio.h>
#include <stdlib.h>   
#include <io.h>
#include <math.h>
#include <time.h>
#include "LoopLinkList.h"

#define number  41

void main(){
	LinkList L ;
	LinkList *ll = &L;
	createTailList(ll,number);
	
	LinkList te = L;
	for(int i = 1; i <= number + 1 ; i++){
		 printf("no : %d data: %d\n",i,L->data);
		L = L->next;
	}
	L = te;
	printf("data: %d\n",L->data);


	printf("=====================\n");
	while(L->next->next != L){
		L = L->next;
		LinkList temp = L->next;
		L->next = L->next->next;
		printf("death-data: %d\n",temp->data);
		free(temp);
		L=L->next;
	}

	printf("=====================\n");
	for(int i = 0; i <4 ; i++){
		printf("%d\n",L->data);
		L = L->next;
	}
}

